package com.example.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.entity.ListOfGoods;
import com.example.service.IListOfGoodsService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2024-09-05
 */
@CrossOrigin
@RestController
@RequestMapping("/uni-app/list-of-goods")
public class ListOfGoodsController {
    @Resource
    IListOfGoodsService listOfGoodsService;

    @RequestMapping("/list")
    public ResponseEntity<IPage<ListOfGoods>> goodsList(@RequestParam(value = "pageIndex") Integer pageIndex, @RequestParam(defaultValue = "6") Integer pageSize){
        return ResponseEntity.ok(listOfGoodsService.listListGoodsId(pageIndex,pageSize));
    }
}
